package com.xiao.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lao xiao
 * @date 2025-06-14 15:19
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private DiscoveryClient discoveryClient;

    @Value("${server.port}")
    private String port;


    @GetMapping("/getPort")
    public String getPort() {
        return port;
    }


    @GetMapping("/getPortTimeOut")
    public String getPortTimeOut() {
        try {
            Thread.sleep(10000);
        } catch (Exception e) {
            //log.error("invoke getPortTimeOut error {} ", , e);
        }
        return port;
    }

}
